package domein;

import java.util.Observable;

/**
 * Notifies of updates the online users list to the gui
 *
 * @author Colin Bundervoet
 * @author Jeroen Pattyn
 */
public class OnlineUsersObservable extends Observable
{
    private String[] onlineUsers;

    /*    public OnlineUsersObservable() {
     onlineUsers = new ArrayList<>();
     }
     */
    /**
     * Updates the userlist with a the new userlist.
     *
     * @param users array of usernames as String
     */
    public void updateOnlineUsers(String[] users) {
        this.onlineUsers = users;
        setChanged();
        notifyObservers();
    }

    /**
     * Returns the current username array of Strings
     *
     * @return String array of usernames.
     */
    public String[] getOnlineUsers() {
        return onlineUsers;
    }
}
